//
//  GW_TextHelper.m
//  Gateway
//
//  Created by shi liangbin on 13-3-7.
//  Copyright (c) 2013年 Archermind. All rights reserved.
//

#import "GW_TextHelper.h"

@implementation GW_TextHelper

+ (BOOL)checkTextContent:(NSString *)txt {
    
    if (txt == nil || [txt isEqualToString:@""] == YES || txt.length == 0) {
        return NO;
    }
    
    NSString *msg = [txt stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
    if (msg == nil || [msg isEqualToString:@""] == YES || msg.length == 0) {
        return NO;
    }
    
    return YES;
    
}


+ (NSString *)getCurrentTime {
    
    NSDate *date = [NSDate date];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    NSString *timeStr = [formatter stringFromDate:date];
    return timeStr;
    
}

+ (NSString *)getCurrentDateAndTime {
    
    NSDate *date = [NSDate date];
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyyMMddHHmmss"];
    NSString *timeStr = [formatter stringFromDate:date];
    return timeStr;
    
}

@end
